<template>
  <uni-card v-for="message in official_messages" v-bind="message" :title="message.title" extra="详情"
    @touchend="handleSwitch(message._id)">
    {{ message.content }}
  </uni-card>

  <!-- <Card v-for="order in favorite.orders" v-bind="order" /> -->
  <!-- <uni-card title="" sub-title="2020.07.08" extra="详情" @touchend="handleSwitch">
    <text>您的身份认证已通过</text>
  </uni-card>

  <uni-card title="镇镇求职1.0已上线" sub-title="2020.07.08" extra="详情" @touchend="handleSwitch">
    <text>期待您的反馈</text>
  </uni-card> -->
</template>

<script setup>
import { computed } from 'vue';
import { useMessagesStore } from '../../stores/messages';
import { ref, reactive } from 'vue';

const allMessages = useMessagesStore()
allMessages.getOrders()
const official_messages = computed(() => {
  return allMessages.messages.filter(m => m.type === 0)
})

function handleSwitch(id) {
  uni.navigateTo({ url: "/pages/detailed_information/detailed_information?id=" + id });
  console.log(id)
}
</script>